import request from '@/utils/request'

// 查询工种列表
export function listProfession(query) {
  return request({
    url: '/system/profession/list',
    method: 'get',
    params: query
  })
}

// 查询工种列表（排除节点）
export function listProfessionExcludeChild(id) {
  return request({
    url: '/system/profession/list/exclude/' + id,
    method: 'get'
  })
}

// 查询工种详细
export function getProfession(id) {
  return request({
    url: '/system/profession/' + id,
    method: 'get'
  })
}

// 查询工种下拉树结构
export function treeselect() {
  return request({
    url: '/system/profession/treeselect',
    method: 'get'
  })
}

// 根据角色ID查询工种树结构
export function roleProfessionTreeselect(roleId) {
  return request({
    url: '/system/profession/roleProfessionTreeselect/' + roleId,
    method: 'get'
  })
}

// 新增工种
export function addProfession(data) {
  return request({
    url: '/system/profession',
    method: 'post',
    data: data
  })
}

// 修改工种
export function updateProfession(data) {
  return request({
    url: '/system/profession',
    method: 'put',
    data: data
  })
}

// 删除工种
export function delProfession(id) {
  return request({
    url: '/system/profession/' + id,
    method: 'delete'
  })
}
